]> dgit.raspbian.org Git - gnome-shell.git/commit
util: Add formatTime() helper method
authorFlorian Müllner <fmuellner@gnome.org>
Wed, 25 Feb 2015 15:43:59 +0000 (16:43 +0100)
committerFlorian Müllner <fmuellner@gnome.org>
Wed, 4 Mar 2015 12:55:01 +0000 (13:55 +0100)
commitebf132770e3edab7fbcd2bd4547d01fcf6f2c7a2
tree4a9d4de9c4559ba382c43cf12d4b38cbbe2490de
parent8f902a9379e1ddf2aded98dd842bf574b3533b00
util: Add formatTime() helper method

Displaying a time is more complex than it appears at first glance:
it should respect the user's choice regarding 12- our 24-hour format (but
only when supported by the locale) and follow the LC_TIME rather than the
LC_MESSAGES setting.
So rather than getting it more or less right in various places, it makes
sense to defer to a helper method which hopefully does the right thing. The
method added by this patch is based on _formatTimestamp in telepathyClient
with some minor tweaks:
 - there's an additional params parameter which allows enforcing
   a time-only format, even on dates other than the current one
 - only a single desktop settings object is created and shared between
   invocations

https://bugzilla.gnome.org/show_bug.cgi?id=745111
js/misc/util.js